//
//  CustomStateBar.m
//  HallOrder
//
//  Created by 蒋 浩锋 on 12-10-29.
//  Copyright (c) 2012年 蒋 浩锋. All rights reserved.
//

#import "CustomStateBar.h"

@implementation CustomStateBar

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        // 将窗体置于正确的位置和级别，就是比状态栏的级别稍高即可
		// 否则该窗体会被标准状态栏遮住，相当于web开发的zoom

		self.windowLevel = UIWindowLevelStatusBar+1.f;
        self.frame = [UIApplication sharedApplication].statusBarFrame;
		self.alpha = 0.f;
		self.hidden = NO;
		// 创建一个灰色图片背景，使他视觉上还是一个标准状态栏的感觉
		UIImageView* backgroundImageView = [[UIImageView alloc] initWithFrame:self.frame];
		backgroundImageView.image = [[UIImage imageNamed:@"CustomStateBar"] stretchableImageWithLeftCapWidth:2 topCapHeight:0];
		[self addSubview:backgroundImageView];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
